package com.ex.ui.infoframe;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class PersonInfoPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JTextField mNameTf;

	JLabel mShowLb;
	/**
	 * Create the panel.
	 */
	public PersonInfoPanel() { 
		mShowLb = null;
		initialize();
	}
	
	public PersonInfoPanel(JLabel lb) { 
		mShowLb = lb;
		initialize();
	}
	
	
	public void initialize()
	{
      setToolTipText("个人信息");
		
		this.setBounds(100, 100, 243, 163);
		setLayout(null); 
		JLabel label = new JLabel("你的姓名：");
		label.setBounds(25, 33, 109, 18);
		add(label);
		
		mNameTf = new JTextField();
		mNameTf.setBounds(111, 30, 86, 24);
		add(mNameTf);
		mNameTf.setColumns(10);
		
		JButton btnNewButton = new JButton("确定");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (mShowLb!=null)
					mShowLb.setText(mNameTf.getText());
			
			}
		});
		btnNewButton.setBounds(67, 70, 113, 27);
		add(btnNewButton);
	}
}
